package com.wlz.date;

import cn.hutool.core.lang.hash.Hash;
import lombok.extern.slf4j.Slf4j;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Objects;

/**
 * @author wlz
 * @date 2022-11-18  3:01 下午
 */
@Slf4j
public class LocalDateTimeTest {

    public static void main(String[] args) throws ParseException {
        System.out.println(LocalDateTime.of(LocalDate.now(), LocalTime.MIN));
        System.out.println(LocalDateTime.now());

        HashMap map = new HashMap<>();
        map.put("date",new Date());
        System.out.println(map.get("date").toString());

        Date date = (Date) map.get("date");
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(sdf2.format(date));


        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(sdf.format(map.get("date")));



//        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        Date date = null;
//        try {
//            date = format.parse(map.get("date").toString());
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }
        System.out.println(date);

    }
}
